package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.Xbqdservice;
import com.zr.serviceImpl.XbqdserviceImpl;

public class XbqdController extends HttpServlet{
   Xbqdservice  x=new XbqdserviceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		 SimpleDateFormat sdf =   new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " ); 
		 String date=sdf.format(new Date());
		 boolean b=x.findxbqd(date);
		 PrintWriter pw=resp.getWriter();
		 if(b){
			 pw.write("true");
		 }else{
			 pw.write("false");
		 }
		 pw.flush();
		 pw.close();
	}
  
}
